﻿@model IEnumerable<MvcPractice.Students>

<p>
    @Html.ActionLink("添加", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @*@Html.DisplayNameFor(model => model.StuName)*@学生姓名
        </th>
        <th>
            @*@Html.DisplayNameFor(model => model.Age)*@年龄
        </th>
        <th>
            @*@Html.DisplayNameFor(model => model.Phone)*@电话
        </th>
        <th>
            @*@Html.DisplayNameFor(model => model.Email)*@邮箱
        </th>
        <th>
            @*@Html.DisplayNameFor(model => model.Class.ClassName)*@班级
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.StuName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Age)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Class.ClassName)
        </td>
        <td>
            @Html.ActionLink("修改", "Edit", new { id=item.StuID }) |
            @Html.ActionLink("详情", "Details", new { id=item.StuID }) |
            @Html.ActionLink("删除", "Delete", new { id=item.StuID })
        </td>
    </tr>
}

</table>
